package cn.edu.scau.cmi.guihao.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Observable;

import cn.edu.scau.cmi.guihao.domin.safetyComponent.Person;
import cn.edu.scau.cmi.guihao.domin.safetyComponent.SmallOrganization;
import cn.edu.scau.cmi.guihao.interProgramming.abstractFactory.Insurance;
import cn.edu.scau.cmi.guihao.interProgramming.abstractFactory.InsuranceCompany;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.text.Text;

public class SafetyComponentController {

	@FXML
	private TextArea displayMessage;

	SmallOrganization rootBranch;
	
	public void Init() {
		rootBranch = new SmallOrganization("root");
		SmallOrganization a1 = new SmallOrganization("组织֯1");
		rootBranch.addOrganization(a1);
		SmallOrganization a2 = new SmallOrganization("组织2");
		rootBranch.addOrganization(a2);
		Person a11 = new Person("人员1");
		a1.addOrganization(a11);
		Person a12 = new Person("人员2");
		a1.addOrganization(a12);
	}
	
	@FXML
	public void onBtnClick() {
		displayMessage.setText(rootBranch.display());
	}

	
	
}
